import config from '../utils/config.js'
export default {
	getByGoodId: ({
		_id,
		cb
	}) => {
		uni.request({
			url: `${config['api_server']}/message/search`,
			data: {
				articleId: _id
			},
			method: "GET",
			header: {
				'custom-header': 'hello' //自定义请求头信息
			},
			success: ({
				data
			}) => {
				cb(data)
			}
		})
	},
	addMsg: (message, cb) => {
		uni.request({
			url: `${config['api_server']}/message/add`,
			data: message,
			method: "POST",
			header: {
				'custom-header': 'hello' //自定义请求头信息
			},
			success: (res) => {
				cb(res)
			}
		})
	}
}
